/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author alumno
 */
@Embeddable
public class HorarioPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "MODG_COD")
    private String modgCod;
    @Basic(optional = false)
    @Column(name = "DIA_COD")
    private int diaCod;

    public HorarioPK() {
    }

    public HorarioPK(String modgCod, int diaCod) {
        this.modgCod = modgCod;
        this.diaCod = diaCod;
    }

    public String getModgCod() {
        return modgCod;
    }

    public void setModgCod(String modgCod) {
        this.modgCod = modgCod;
    }

    public int getDiaCod() {
        return diaCod;
    }

    public void setDiaCod(int diaCod) {
        this.diaCod = diaCod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (modgCod != null ? modgCod.hashCode() : 0);
        hash += (int) diaCod;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HorarioPK)) {
            return false;
        }
        HorarioPK other = (HorarioPK) object;
        if ((this.modgCod == null && other.modgCod != null) || (this.modgCod != null && !this.modgCod.equals(other.modgCod))) {
            return false;
        }
        if (this.diaCod != other.diaCod) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.HorarioPK[ modgCod=" + modgCod + ", diaCod=" + diaCod + " ]";
    }

}
